<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="resource/scene/update" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">动画编号</label>
        <div class="layui-input-block">
            <input type="text" name="sceneNumber" value='${scene.sceneNumber!""}' required="required" title="请输入动画编号" placeholder="请输入动画编号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色状态</label>
        <div class="layui-input-inline">
        	<select name="roleStatus" >
        		<#if scene.roleStatus==0>
	        		<option value="0" selected>待机</option>
	        	<#else>
	        		<option value="0">待机</option>
	        	</#if>
	        	
	        	<#if scene.roleStatus==1>
	        		<option value="1" selected>脚本</option>
	        	<#else>
	        		<option value="1">脚本</option>
	        	</#if>
	        	
	        	<#if scene.roleStatus==2>
	        		<option value="2" selected>引导</option>
	        	<#else>
	        		<option value="2">引导</option>
	        	</#if>
	        	
	        	<#if scene.roleStatus==3>
	        		<option value="3" selected>互动</option>
	        	<#else>
	        		<option value="3">互动</option>
	        	</#if>
	        	
	        	<#if scene.roleStatus==4>
	        		<option value="4" selected>提示</option>
	        	<#else>
	        		<option value="4">提示</option>
	        	</#if>
		    </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">动画序列</label>
        <div class="layui-input-inline">
            <input type="text" name="sceneOrder" value='${scene.sceneOrder!""}' placeholder="请输入动画序列" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">关联影片</label>
        <div class="layui-input-inline">
        	<input type='hidden' id="resource_id" value='${scene.resource_id!""}' name='resource_id'/>
            <input type="text" id="resource_name" name="resource_name" value='${scene.resource_name!""}' readonly title="请选择影片" placeholder="请选择影片" class="layui-input">
        </div>
        <div class="layui-input-inline">
        	<button data-iframe='resource/selectResource' type='button' data-title="选择影片" class='layui-btn layui-btn-small'>选择</button>
        	<button type='button' onclick="clean_resource();" class='layui-btn layui-btn-small layui-btn-danger'>清除</button> 
        </div> 
    </div>
	<div class="layui-form-item">
        <label class="layui-form-label">音频地址</label>
        <div class="layui-input-block">
            <input type="text" name="audioUrl" value='${scene.audioUrl!""}' title="请输入音频地址" placeholder="请输入音频地址" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">音频时长</label>
        <div class="layui-input-inline">
            <input type="text" name="audioTime" value='${scene.audioTime!""}'  placeholder="请输入音频时长（秒）" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">关联编号</label>
        <div class="layui-input-inline">
            <input type="text" name="relation_number" value='${scene.relation_number!""}' placeholder="请输入关联编号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">适用时段</label>
        <div class="layui-input-inline">
        	<select name="playTime" >
        		<#if scene.playTime==0>
	        		<option value="0" selected>不限</option>
	        	<#else>
	        		<option value="0">不限</option>
	        	</#if>
        		<#if scene.playTime==1>
	        		<option value="1" selected>早上</option>
	        	<#else>
	        		<option value="1">早上</option>
	        	</#if>
        		<#if scene.playTime==2>
	        		<option value="2" selected>中午</option>
	        	<#else>
	        		<option value="2">中午</option>
	        	</#if>
        		<#if scene.playTime==3>
	        		<option value="3" selected>晚上</option>
	        	<#else>
	        		<option value="3">晚上</option>
	        	</#if>
		    </select>
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label">描述</label>
	    <div class="layui-input-block">
	      <textarea name="describe" placeholder="请输入内容" class="layui-textarea">${scene.describe!""}</textarea>
	    </div>
	 </div>
	 
    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
    	<input type='hidden' value='${scene.id!""}' name='id'/>
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
    <script>window.form.render();</script>
</form>
<script>
function selectedResource(id,name){
	$('#resource_id').val(id);
	$('#resource_name').val(name);
	layer.close(layer.index);
};

function clean_resource(){
	$('#resource_id').val("");
	$('#resource_name').val("");
};
</script>